home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1999 March
/
EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso
/
earcd
/
-archivi
/
-recent2
/
amhelios.lha
/
AmHelios
/
calcsub.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-08-31
|
3KB
|
103 lines
/* -------------------------------------------------------------------------- *\
CALCSUB.H
Copyright © 1997 by Jarno van der Linden
jarno@kcbbs.gen.nz
Calculation subtask for AmHelios.
Header file
This program is Freeware, and all usual Freeware rules apply.
24 Aug 1997: Project started
\* -------------------------------------------------------------------------- */
/* -------------------------------- Includes -------------------------------- */
#include <exec/types.h>
#include <exec/ports.h>
#if (defined(_HEMI_CUBE) || defined(_CUBIC_TETRA))
#include "prog_rad.h"
#elif defined(_RAY_CAST)
#include "ray_rad.h"
#else
#include "rad_eqn.h"
#endif
/* ------------------------------ Definitions ------------------------------- */
/* --------------------------------- Macros --------------------------------- */
/* -------------------------------- Typedefs -------------------------------- */
/* -------------------------------- Structs --------------------------------- */
class SubTask
{
public:
SubTask(char *name);
virtual ~SubTask();
void Start();
void Stop();
void Suspend();
void Resume();
protected:
LONG SendSubTaskMsg(WORD command,APTR params);
void KillSubTask();
virtual void StartFunc() { ; };
virtual BOOL SubFunc() { return FALSE; };
virtual void StopFunc() { ; };
virtual LONG HandleMessage(WORD command,APTR parameter) { return 0; };
private:
struct SubTaskMsg
{
struct Message stm_Message;
WORD stm_Command;
APTR stm_Parameter;
LONG stm_Result;
};
void SpawnSubTask(char *name);
static void ExitSubTask(SubTask *thisst,struct SubTaskMsg *stm);
static SubTask *InitSubTask(void);
static void __asm __saveds Main(void);
private:
struct Task *task; /* sub task pointer */
struct MsgPort *port; /* allocated by sub task */
struct MsgPort *reply; /* allocated by main task */
struct SubTaskMsg message; /* Message buffer */
};
class CalcSub : public SubTask
{
public:
CalcSub(char *name,RadEqnSolve *radiosity,Environ *env);
void Snapshot();
protected:
void StartFunc();
BOOL SubFunc();
void StopFunc();
void SnapshotFunc();
LONG HandleMessage(WORD command,APTR parameter);
protected:
#if (defined(_HEMI_CUBE) || defined(_CUBIC_TETRA))
ProgRad *radiosity; // Progressive radiosity
#elif defined(_RAY_CAST)
RayRad *radiosity; // Ray cast radiosity
#else
RadEqnSolve *radiosity; // Dummy equation solver
#endif
Environ *env;
};